<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div1 {
            width: 200px;
            height: 200px;
            background-color: #f0f0f0;
        }
    </style>
</head>
<body>
    <div class="div1" id="div1">
        <button class="btn1">tap</button>
    </div>
    <script src="./hammer.min.js"></script>
    <script>
        // 创建实例，将hammer应用在某个元素上
        var hammer = new Hammer(document.getElementById('div1'));

        hammer.on('tap', function() {
            console.log('tap')
        })
    </script>
</body>
</html>